package com.dc.system.controller;

import com.dc.common.model.BaseModel;
import com.dc.project.model.StudentUser;
import com.dc.project.service.StudentUserService;
import com.dc.system.model.SysDept;
import com.dc.system.model.SysOrgan;
import com.wordnik.swagger.annotations.ApiImplicitParam;
import com.wordnik.swagger.annotations.ApiImplicitParams;
import com.wordnik.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description: StudentUserController
 * @Author: ChenXueLi
 * @Date: 2018-05-07 15:16
 */
@Controller
@RequestMapping("/student")
public class StudentUserController {

    @Autowired
    private StudentUserService studentUserService;

    @ApiOperation(value = "学生用户登录", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "account", value = "登陆用户名", required = true, paramType = "query"),
            @ApiImplicitParam(name = "password", value = "登录用户密码", required = true, paramType = "query")
    })
    @RequestMapping("/login")
    @ResponseBody
    public BaseModel login(StudentUser studentUser, BaseModel baseModel, HttpServletRequest request) throws Exception{
        return studentUserService.login(studentUser, baseModel ,request);
    }

}
